package zhishuang.wang.sansi.playlist.entry;

/**
 * @Author Zhishuang.Wang
 * @Date 2023/7/5 11:09
 * @Email 1406110602@qq.com
 */

import zhishuang.wang.sansi.tools.ReturnData;

public class BaseColour {
    private Integer red;
    private Integer green;
    private Integer blue;
    private Integer alpha;
    private Integer amber;


    public BaseColour(int red, int green, int blue, int alpha, int amber) {
        this.red = red;
        this.green = green;
        this.blue = blue;
        this.alpha = alpha;
        this.amber = amber;
    }

    public ReturnData checkParam() {
        ReturnData rd = new ReturnData();
        rd.setCode(1);
        String errorMes = "";
        if (this.red != null && (this.red < 0 || this.red > 255)) {
            errorMes = errorMes + "红色基准值范围：0-255；";
        }

        if (this.green != null && (this.green < 0 || this.green > 255)) {
            errorMes = errorMes + "绿色基准值范围：0-255；";
        }

        if (this.blue != null && (this.blue < 0 || this.blue > 255)) {
            errorMes = errorMes + "蓝色基准值范围：0-255；";
        }

        if (this.alpha != null && (this.alpha < 0 || this.alpha > 255)) {
            errorMes = errorMes + "alpha基准值范围：0-255；";
        }

        if (this.amber != null && (this.amber < 0 || this.amber > 255)) {
            errorMes = errorMes + "琥珀色基准值范围：0-255；";
        }

        if (errorMes != null && errorMes.length() != 0) {
            rd.setMessage(errorMes);
        } else {
            rd.setCode(0);
        }

        return rd;
    }

    public Integer getRed() {
        return this.red;
    }

    public void setRed(Integer red) {
        this.red = red;
    }

    public Integer getGreen() {
        return this.green;
    }

    public void setGreen(Integer green) {
        this.green = green;
    }

    public Integer getBlue() {
        return this.blue;
    }

    public void setBlue(Integer blue) {
        this.blue = blue;
    }

    public Integer getAlpha() {
        return this.alpha;
    }

    public void setAlpha(Integer alpha) {
        this.alpha = alpha;
    }

    public Integer getAmber() {
        return this.amber;
    }

    public void setAmber(Integer amber) {
        this.amber = amber;
    }
}
